package com.cloudfun.campusshare.repo;

import com.cloudfun.campusshare.entity.DailyBalanceAccountEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.time.LocalDate;

/**
 * @author : zhangyongjie
 * @version : 1.0
 * @createTime : 2020/6/1 16:53
 * @description :
 */
public interface DailyBalanceAccountEntityRepo extends JpaRepository<DailyBalanceAccountEntity, String>, JpaSpecificationExecutor<DailyBalanceAccountEntity> {
    @Query(value="select bill_date from daily_balance_account where merchant_id=?1 ORDER BY bill_date ASC limit 1",nativeQuery=true)
    LocalDate getEarlyBillDate(String merchantId);
}
